import React from "react";
import * as THREE from "three";
import Controller from "..";

export default function useReceiveProps(controller: Controller, material?: THREE.Material, onChange?: (e: THREE.Material) => void) {
    React.useEffect(()=>{
        controller.run(async s=>{
            s.material = material;
            s.onChange = onChange;
        })
    }, [controller, material, onChange])
}